#!/usr/bin/env python

import Options

def configure(conf):
    conf.CHECK_HEADERS('float.h')

    if conf.CHECK_BUNDLED_SYSTEM('iniparser', checkfunctions='iniparser_load', headers='iniparser.h'):
        conf.define('USING_SYSTEM_INIPARSER', 1)

def build(bld):
    if bld.CONFIG_SET('USING_SYSTEM_INIPARSER'):
        return

    bld.SAMBA_LIBRARY('iniparser',
                      source='''../../iniparser_build/iniparser.c
                                ../../iniparser_build/dictionary.c
                                ../../iniparser_build/strlib.c''',
                      cflags='',
                      deps='replace',
                      private_library=True)
